﻿using System;
using CSW.Framework.Common;
using CSW.Framework.Linq.SchemaModel;

namespace CSW.Framework.Linq.QueryModel
{
    /// <summary>
    /// Property
    /// </summary>
    public class Property
    {
        /*/// <summary>
        /// Initializes a new instance of the <see cref="Property"/> class.
        /// </summary>
        public Property()
        {
            ObjectCounter.Add(this);
        }

        /// <summary>
        /// Releases unmanaged resources and performs other cleanup operations before the
        /// <see cref="Property"/> is reclaimed by garbage collection.
        /// </summary>
        ~Property()
        {
            ObjectCounter.Remove(this);
        }*/

        /// <summary>
        /// Gets or sets the container.
        /// </summary>
        /// <value>The container.</value>
        public Container Container { get; set; }

        /// <summary>
        /// Gets or sets the table column.
        /// </summary>
        /// <value>The table column.</value>
        public TableColumn TableColumn { get; set; }

        /// <summary>
        /// Gets or sets the name of the returned column.
        /// </summary>
        /// <value>The name of the returned column.</value>
        public string ReturnedColumnName { get; set; }

        /// <summary>
        /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
        /// </returns>
        public override string ToString()
        {
            return string.Format("{0}.{1}", Container, TableColumn);
        }
    }
}